<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Ruler Column</title>
<style type="text/css">@import url("file:/home/moovida/rcpdevelopment/eclipse/configuration/org.eclipse.osgi/bundles/488/1/.cp/book.css");</style>
<style type="text/css">@import url("file:/home/moovida/rcpdevelopment/eclipse/configuration/org.eclipse.osgi/bundles/505/1/.cp/schema.css");</style>
</HEAD>
<BODY>
<H1 style="text-align:center">Ruler Column</H1>
<p></p>
<h6 class="CaptionFigColumn SchemaHeader">Identifier: </h6>org.eclipse.ui.workbench.texteditor.rulerColumns<p></p>
<h6 class="CaptionFigColumn SchemaHeader">Since: </h6>3.3
<p></p>

<h6 class="CaptionFigColumn SchemaHeader">Description: </h6>Ruler column contributions are line based information areas that are normally shown in the vertical ruler area of a textual editor.<p></p>
<h6 class="CaptionFigColumn SchemaHeader">Configuration Markup:</h6>
<p></p>
<p class="code SchemaDtd">&lt;!ELEMENT <a name="e.extension">extension</a> (<a href="#e.column">column</a>+)&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST extension</p>
<p class="code SchemaDtdAttlist">point&nbsp;CDATA #REQUIRED</p><p class="code SchemaDtdAttlist">id&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</p><p class="code SchemaDtdAttlist">name&nbsp;&nbsp;CDATA #IMPLIED</p>&gt;</p>
<p></p>
<ul class="ConfigMarkupAttlistDesc">
<li><b>point</b> - a fully qualified identifier of the target extension point</li>
<li><b>id</b> - an optional identifier of the extension instance</li>
<li><b>name</b> - an optional name of the extension instance</li>
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.column">column</a> ((<a href="#e.targetEditor">targetEditor</a> | <a href="#e.targetContentType">targetContentType</a> | <a href="#e.targetClass">targetClass</a>)+ , <a href="#e.placement">placement</a>)&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST column</p>
<p class="code SchemaDtdAttlist">id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</p><p class="code SchemaDtdAttlist">name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</p><p class="code SchemaDtdAttlist">icon&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</p><p class="code SchemaDtdAttlist">class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</p><p class="code SchemaDtdAttlist">enabled&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(true | false) "true"</p><p class="code SchemaDtdAttlist">global&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(true | false) "true"</p><p class="code SchemaDtdAttlist">includeInMenu&nbsp;(true | false) "true"</p>&gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
The specification of a ruler column contribution.</p>
<br>
<ul class="ConfigMarkupAttlistDesc">
<li><b>id</b> - the unique id of this column</li>
<li><b>name</b> - an optional name of the column, may be used in the user interface (e.g. in preference pages)</li>
<li><b>icon</b> - an optional icon for the column. May be used in the user interface, for example on preference pages.</li>
<li><b>class</b> - the class implementing the column; must implement <code>org.eclipse.ui.texteditor.rulers.IContributedRulerColumn</code></li>
<li><b>enabled</b> - the default enablement state of this column</li>
<li><b>global</b> - controls whether toggling the visibility of this column operates on all targeted editors, or only the active editor. If true, the ruler is added to all applicable editors when the user enables the column; if false, the ruler is only added to the active editor.</li>
<li><b>includeInMenu</b> - whether to include a "Show/Hide" menu entry for this column in the ruler context menu</li>
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.targetEditor">targetEditor</a> EMPTY&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST targetEditor</p>
<p class="code SchemaDtdAttlist">id&nbsp;IDREF #REQUIRED</p>&gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
Describes an editor that the column is contributed to.  See the <tt>org.eclipse.ui.editors</tt> extension point. Note that the rulerColumns extension point is typically only supported by line based text editors.</p>
<br>
<ul class="ConfigMarkupAttlistDesc">
<li><b>id</b> - the editor id of the target editor</li>
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.targetContentType">targetContentType</a> EMPTY&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST targetContentType</p>
<p class="code SchemaDtdAttlist">id&nbsp;CDATA #REQUIRED</p>&gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
Describes a content type that the column is contributed to. See the <tt>org.eclipse.core.runtime.contentTypes</tt> extension point. Note that the rulerColumns extension point is typically only supported by line based text editors.</p>
<br>
<ul class="ConfigMarkupAttlistDesc">
<li><b>id</b> - the id of the target content type</li>
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.targetClass">targetClass</a> EMPTY&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST targetClass</p>
<p class="code SchemaDtdAttlist">class&nbsp;CDATA #REQUIRED</p>&gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
Describes an editor class that the column is contributed to. Subclasses of the specified class are also targeted by this colum contribution.</p>
<br>
<ul class="ConfigMarkupAttlistDesc">
<li><b>class</b> - the fully qualified name of a class implementing <code>org.eclipse.ui.texteditor.ITextEditor</code>. The class does not need to be instantiatable. Note that contributing ruler columns to an internal editor class outside of the contributor's namespace is considered bad practice, as the class name may change without notice.</li>
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.placement">placement</a> ((<a href="#e.before">before</a> | <a href="#e.after">after</a>))*&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST placement</p>
<p class="code SchemaDtdAttlist">gravity&nbsp;CDATA "1.0"</p>&gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
Describes the placement of this ruler column relative to other contributed columns. A column may request to be placed <em>before</em> or <em>after</em> other known columns (identified by their <tt>id</tt>). Columns that would end up at the same position are ordered by <em>gravity</em> (see below). If the ordering is contradicting or no ordering can be found that fulfills all placement requests, some placement requirements are dropped until the placement can be achieved. If a column does not fully specify its placement it will be placed at an arbitrary but consistent location.</p>
<br>
<ul class="ConfigMarkupAttlistDesc">
<li><b>gravity</b> - a float number between 0.0 and 1.0 that tells how close the column wants to be to the editor, where 0.0 means as far away as possible and 1.0 means as close as possible. After all <i>before</i> and <i>after</i> constraints are evaluated, columns that would end up at the same position are ordered by their <i>gravity</i> value.</li>
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.before">before</a> EMPTY&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST before</p>
<p class="code SchemaDtdAttlist">id&nbsp;IDREF #REQUIRED</p>&gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
Requests placement before another column. The meaning of <i>before</i> is similar to the SWT.LEAD flag: In left-to-right environments, <i>before</i> means <i>to the left of</i>, in right-to-left environments, it means <i>to the right of</i>.</p>
<br>
<ul class="ConfigMarkupAttlistDesc">
<li><b>id</b> - the id of another <tt>rulerColumns</tt> contribution</li>
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.after">after</a> EMPTY&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST after</p>
<p class="code SchemaDtdAttlist">id&nbsp;IDREF #REQUIRED</p>&gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
Requests placement after another column. The meaning of <i>after</i> is similar to the SWT.TRAIL flag: In left-to-right environments, <i>after</i> means <i>to the right of</i>, in right-to-left environments, it means <i>to the left of</i>.</p>
<br>
<ul class="ConfigMarkupAttlistDesc">
<li><b>id</b> - the id of another <tt>rulerColumns</tt> contribution</li>
</ul>
<br><h6 class="CaptionFigColumn SchemaHeader">Examples: </h6>The following is an example of a ruler column definition:
<pre class="Example"><span class="code SchemaTag">
&lt;extension
  point=</span><span class="code SchemaCstring">&quot;org.eclipse.ui.workbench.texteditor.rulerColumns&quot;</span><span class="code SchemaTag">&gt;
  &lt;column
    id=</span><span class="code SchemaCstring">&quot;org.eclipse.ui.editors.columns.linenumbers&quot;</span><span class="code SchemaTag">
    name=</span><span class="code SchemaCstring">&quot;Line Numbers&quot;</span><span class="code SchemaTag">
    class=</span><span class="code SchemaCstring">&quot;org.eclipse.ui.internal.texteditor.LineNumberColumn&quot;</span><span class="code SchemaTag">
    enabled=</span><span class="code SchemaCstring">&quot;false&quot;</span><span class="code SchemaTag">
    global=</span><span class="code SchemaCstring">&quot;true&quot;</span><span class="code SchemaTag">
    includeInMenu=</span><span class="code SchemaCstring">&quot;false&quot;</span><span class="code SchemaTag">&gt;
    &lt;placement
       gravity=</span><span class="code SchemaCstring">&quot;0.9&quot;</span><span class="code SchemaTag">&gt;
       &lt;after id=</span><span class="code SchemaCstring">&quot;org.eclipse.ui.editors.columns.annotations&quot;</span><span class="code SchemaTag">/&gt;
    &lt;/placement&gt;
    &lt;targetClass
       class=</span><span class="code SchemaCstring">&quot;org.eclipse.ui.texteditor.AbstractDecoratedTextEditor&quot;</span><span class="code SchemaTag">&gt;
    &lt;/targetClass&gt;
  &lt;/column&gt;
&lt;/extension&gt;
</span></pre>
<p></p>

<h6 class="CaptionFigColumn SchemaHeader">API Information: </h6>The extension point is supported by the <tt>org.eclipse.ui.texteditor.rulers</tt> package. <code>RulerColumnRegistry</code> gives access to all contributions, which in turn are described by <code>RulerColumnDescriptor</code> instances.
<p>Editors that want to support the extension point need to provide an adapter for <code>IColumnSupport</code>. <code>AbstractTextEditor</code> already adapts to <code>IColumnSupport</code> and hence its subclasses should override <code>createColumnSupport()</code> with the suggested implementation, rather than providing the adapter again. Subclasses of <code>AbstractDecoratedTextEditor</code> automatically have this support installed.</p>
<p></p>

<h6 class="CaptionFigColumn SchemaHeader">Supplied Implementation: </h6>All ruler column contributions must implement <code>org.eclipse.ui.texteditor.rulers.IContributedRulerColumn</code>. Many contributors will find the supplied <code>org.eclipse.ui.texteditor.rulers.AbstractContributedRulerColumn</code> useful which serves as super class for contributed ruler columns. Others might start off <code>org.eclipse.jface.text.source.AbstractRulerColumn</code> which takes over most painting and scrolling aspects of a line based column and can be extended at various granularity levels. Those subclassing the latter class will have to implement <code>org.eclipse.ui.texteditor.rulers.IContributedRulerColumn</code> on their own by using <code>org.eclipse.ui.texteditor.rulers.AbstractContributedRulerColumn</code> as template.
<p></p>

<br>
<p class="note SchemaCopyright">
Copyright (c) 2006, 2008 IBM Corporation and others.<br>
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>

</p>
</BODY>
</HTML>
